package com.link.demo;

import com.link.entity.Account;
import com.link.service.AccountService;
import org.junit.runner.RunWith;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by wangyg 
 * on 2017/2/21 21:14
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/applicationContext.xml")
public class SpringDemo1 {

	@Autowired
	private AccountService accountService;

	@Test
	public void testTransfer() throws Exception {
		//		ApplicationContext context=new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
		accountService.transfer("1", "2", 200d);
	}

	@Test
	public void testSelect() throws Exception {
		//		ApplicationContext context=new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
		Account select = accountService.select("1");
		System.out.println(select);
	}

}
